package thread;

public class Demo08 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        t.start();
        Thread.sleep(2000);
        System.out.println(t.isAlive()); // 判断是否存在 注意这里是指线程是否存在，不是t这个对象的生命周期

    }
}
